fix(examples): harden runnable example flows#770
Conversation
ade4ab6 to
d7932fc
Compare
d7932fc to
52d4de9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d7932fc945
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if len(sessionSecret()) == 0 { | ||
| return response.RedirectTo("/?login=failed"), nil |
There was a problem hiding this comment.
Keep the learning-path serve command valid
With this new secret requirement, the run command still shown in docs/learning/native.md:184 starts the flagship binary with only GOWDK_CSRF_SECRET. Following that documented path leaves GOWDK_FLAGSHIP_SECRET empty, so every login redirects to /?login=failed and readers cannot exercise the protected dashboard; please update that command to include the new required flagship secret/password values or reuse the README command.
Useful? React with 👍 / 👎.
52d4de9 to
78c2756
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 52d4de9753
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| | Contracts and realtime | `examples/contracts/` | `go run ./cmd/gowdk build --config examples/contracts/gowdk.config.go --out /tmp/gowdk-contracts-build --app /tmp/gowdk-contracts-app --bin /tmp/gowdk-contracts-site examples/contracts/patients.page.gwdk` | | ||
| | CSS and Tailwind | `examples/css/`, `examples/tailwind/` | `go run ./cmd/gowdk build --config examples/css/gowdk.config.go --out /tmp/gowdk-css-build examples/css/styled.page.gwdk` | | ||
| | CSS | `examples/css/` | `go run ./cmd/gowdk build --config examples/css/gowdk.config.go --out /tmp/gowdk-css-build examples/css/styled.page.gwdk` | | ||
| | Tailwind | `examples/tailwind/` | `go run ./cmd/gowdk build --config examples/tailwind/gowdk.config.go --out /tmp/gowdk-tailwind-build examples/tailwind/site.page.gwdk` | |
There was a problem hiding this comment.
Fix the Tailwind example build command
When a reader has tailwindcss installed and runs this newly documented root command, the project helper executes the build from examples/tailwind, while the config still sets the Tailwind input to examples/tailwind/app.css. The generated Tailwind input therefore imports examples/tailwind/examples/tailwind/app.css, which does not exist, so the build fails before producing the example output; either make the config input project-relative or document a command that matches the existing config.
Useful? React with 👍 / 👎.
78c2756 to
6fa6c99
Compare
Summary
Fixes #765.
Fixes #766.
Fixes #767.
Fixes #768.
Fixes #769.
This updates the runnable examples so copied example code does not carry unsafe auth defaults, points the examples inventory at real runnable sources, and makes the parser fuzz smoke deterministic enough for CI.
Changes
GOWDK_FLAGSHIP_SECRETfor flagship session signing and fail closed when it is missing.GOWDK_FLAGSHIP_PASSWORDinstead of accepting a hardcoded demo password fallback.cd examples/flagship && make buildworks..gwdkpages, keep the Tailwind example config project-relative, and document that Tailwind build requires the externaltailwindcssexecutable.GOWDK_FUZZTIME=1000x, avoiding intermittentcontext deadline exceededfailures while still exercisingFuzzParseSyntax.Validation
scripts/test-parser-fuzz.shgo test ./examples/flagship/src/appgo test ./examples/i18ngo test ./runtime/ratelimitcd examples/flagship && make clean && make buildgo run ./cmd/gowdk build --config examples/i18n/gowdk.config.go --out /tmp/gowdk-i18n-build-pr2 examples/i18n/*.gwdkgo run ./cmd/gowdk build --config examples/seo/gowdk.config.go --out /tmp/gowdk-seo-build-pr2 examples/seo/*.gwdkgo run ./cmd/gowdk check --config examples/tailwind/gowdk.config.go examples/tailwind/site.page.gwdkscripts/check-docs-style.shscripts/check-docs-links.shNote: the full Tailwind build still requires the external
tailwindcssCLI onPATH; the source check passes without that optional tool.